<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateTableCarousels extends Migration {
	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up() {
		Schema::create('carousels', function (Blueprint $table) {
			$table->increments('id');
			$table->integer('user_id')->comment('用户id');
			$table->string('title', 50)->nullable()->comment('标题');
			$table->text('image')->comment('图片链接');
			$table->boolean('status')->default(true)->comment('状态')->index();
			$table->index('user_id');
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down() {
		Schema::dropIfExists('carousels');
	}
}
